import { positionUpdateSchema } from "~/validators/position";

let schema = PositionSchema;

export default defineEventHandler(async (event) => {
  const result = await runValidate(positionUpdateSchema, event);
  const newData = schema.findByIdAndUpdate(result.data._id, result.data, {
    new: true,
  });
  return newData;
});
